package com.dream.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/**
 * 标签表
 * 
 * @author Administrator
 *
 */
@Entity
@Table(name = "sys_lable")
public class Sys_Lable extends AllId implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;// 标签的名称

	private Integer lableImportance = 0;// 重要性，0-0

	private Integer lableValue; // 标准的分值

	private String type;// 标签的类型 //0专家标签，1普通标签

	private String jiaocai;

	private String lableId;// 本级的ID

	private String lablePid;// 他的PID

	private SysUser sysUser; // 标签增加所有者

	private List<Sys_LearnPlant_Lable> listlp = null; // 标准属于多少个学期计划

	private List<Sys_User_Lable> listsul = null;// 一个标签，可能归属于多个老师，学生和专家

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_Lable", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20)
	public List<Sys_User_Lable> getListsul() {
		return listsul;
	}

	public void setListsul(List<Sys_User_Lable> listsul) {
		this.listsul = listsul;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_Lable", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20)
	public List<Sys_LearnPlant_Lable> getListlp() {
		return listlp;
	}

	public void setListlp(List<Sys_LearnPlant_Lable> listlp) {
		this.listlp = listlp;
	}
 
	@Column(name="cname")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getLableImportance() {
		return lableImportance;
	}

	public void setLableImportance(Integer lableImportance) {
		this.lableImportance = lableImportance;
	}

	public Integer getLableValue() {
		return lableValue;
	}

	public void setLableValue(Integer lableValue) {
		this.lableValue = lableValue;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getLableId() {
		return lableId;
	}

	public void setLableId(String lableId) {
		this.lableId = lableId;
	}

	public String getLablePid() {
		return lablePid;
	}

	public void setLablePid(String lablePid) {
		this.lablePid = lablePid;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getJiaocai() {
		return jiaocai;
	}

	public void setJiaocai(String jiaocai) {
		this.jiaocai = jiaocai;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade(CascadeType.PERSIST)
	public SysUser getSysUser() {
		return sysUser;
	}

	public void setSysUser(SysUser sysUser) {
		this.sysUser = sysUser;
	}

	public Sys_Lable(String table_id, String lableName, Integer lableImportance, Integer lableValue, String type, String jiaocai, String lableId, String lablePid, String userName,String userTable_id,String showTime) {
		super(table_id);
		this.name = lableName;
		this.lableImportance = lableImportance;
		this.lableValue = lableValue;
		this.type = type;
		this.jiaocai = jiaocai;
		this.lableId = lableId;
		this.lablePid = lablePid;
		super.setString1(userName);
		super.setString2(userTable_id);
		super.setShowTime(showTime);
	}
	 
	public Sys_Lable(String table_id, String lableName, Integer lableImportance, Integer lableValue, String type, String jiaocai, String lableId, String lablePid, String showTime) {
		super(table_id);
		this.name = lableName;
		this.lableImportance = lableImportance;
		this.lableValue = lableValue;
		this.type = type;
		this.jiaocai = jiaocai;
		this.lableId = lableId;
		this.lablePid = lablePid;
		super.setShowTime(showTime);
	}
	public Sys_Lable() {
	}

}
